#!/bin/ksh
PATH=$PATH:/home/oracle/scripts ; export PATH
STATUS_DIR=/oracle/backup/BK_STATUS
BKUP=/oracle/backup
LOG=/tmp/Backup.log
MSG_LOG=/oracle/backup/log/joblog_`date +%Y%m`.log ;export MSG_LOG
JOBNAME=Backup_LDAP          ; export JOBNAME
DATE_FORMAT=`date +%Y%m%d`

RC_CHK()
{
RC=$1
NAME=$2
if [[ $RC != 0 ]]
  then
      MSG_JOB E "Tar Err($RC) $NAME"
      exit 1
  else
      MSG_JOB I "Tar $NAME Successfully"
fi
}
MSG_JOB S

# Disk Backup -------------------------------------------------------
cd $BKUP
(/bin/tar czvf CRMSRV1_LDAP_$DATE_FORMAT.tgz /usr/local/etc/openldap/slapd.conf /usr/local/var/openldap-data /etc/syslog.conf) >>$LOG 2>&1
RC=$?; RC_CHK $RC "LDAP"
MSG_JOB N 
